/**
 * jims
 */
package com.jims.master.modules.drug.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jims.master.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.beans.Transient;
import java.util.Date;

/**
 * 药品出库明细Entity
 * @author fengyg
 * @version 2017-03-16
 */
public class DrugExportDetail extends DataEntity<DrugExportDetail> {
	
	private static final long serialVersionUID = 1L;
	private String masterId;		// 出库主表ID
	private String itemNo;		// 序号
	private String infoId;		// drug_info表ID
	private String drugCode;		// 药品编码
	private String packageNum;		// 包装数量
	private String packageSpec;		// 包装规格
	private String packageUnits;		// 包装单位
	private String minSpec;		// 最小规格
	private String minUnits;		// 最小单位
	private String batchNo;		// 批号
	private Date expireDate;		// 有效期
	private Double purchasePrice;		// 出库价
	private String discount;		// 折扣
	private Double quantity;		// 出库大包装数量
    private Double quantityBad;   //报损数量
    private Double quantityOut;   //出库数量

    public Double getQuantityOut() {
        return quantityOut;
    }

    public void setQuantityOut(Double quantityOut) {
        this.quantityOut = quantityOut;
    }

    public Double getQuantityBad() {
        return quantityBad;
    }

    public void setQuantityBad(Double quantityBad) {
        this.quantityBad = quantityBad;
    }

    private Double inventory;		// 出库后库存数(大包装)
	private String importMasterId;		// 对应的入库主表ID
    private DrugPrice drugPrice;     //药品价格
    private DrugStock drugStock;    //药品库存
    private DrugInfo drugInfo;      //药品信息
    private DrugStorageDept drugStorageDept;  //库存单位
    private DrugInoutClass drugInoutClass;    //出库类别
    private DrugExportMaster drugExportMaster;  //出库主表
	private  String drugName; //药品名称
    private DrugSupplierCata drugSupplierCata;  //供应商

//    扩展
    private String tradePrice; //进货价
    private String retailPrice;//零售价
    private String exportClass;//出库类别
    private String receiver;//发往
    private Date exportDate;//出库日期
    private String documentNo;//出库单号
    private String storageName;//发货单位
    private int index;//序号
    private int num;//品种数量
    private String storageId;
    @Transient
    public String getStorageId() {
        return storageId;
    }
    @Transient
    public void setStorageId(String storageId) {
        this.storageId = storageId;
    }

    @Transient
    public int getNum() {
        return num;
    }
    @Transient
    public void setNum(int num) {
        this.num = num;
    }

    @Transient
    public int getIndex() {
        return index;
    }
    @Transient
    public void setIndex(int index) {
        this.index = index;
    }

    @Transient
    public String getStorageName() {
        return storageName;
    }
   @Transient
    public void setStorageName(String storageName) {
        this.storageName = storageName;
    }

    @Transient
    public String getDocumentNo() {
        return documentNo;
    }
    @Transient
    public void setDocumentNo(String documentNo) {
        this.documentNo = documentNo;
    }

    @Transient
    public String getTradePrice() {
        return tradePrice;
    }
    @Transient
    public void setTradePrice(String tradePrice) {
        this.tradePrice = tradePrice;
    }
    @Transient
    public String getRetailPrice() {
        return retailPrice;
    }
    @Transient
    public void setRetailPrice(String retailPrice) {
        this.retailPrice = retailPrice;
    }
    @Transient
    public String getExportClass() {
        return exportClass;
    }
    @Transient
    public void setExportClass(String exportClass) {
        this.exportClass = exportClass;
    }
    @Transient
    public String getReceiver() {
        return receiver;
    }
    @Transient
    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }
    @Transient
    public Date getExportDate() {
        return exportDate;
    }
    @Transient
    public void setExportDate(Date exportDate) {
        this.exportDate = exportDate;
    }

    private String createDateStr;
    private String updateDateStr;

    @Transient
    public String getCreateDateStr() {
        return createDateStr;
    }

    @Transient
    public void setCreateDateStr(String createDateStr) {
        this.createDateStr = createDateStr;
    }

    @Transient
    public String getUpdateDateStr() {
        return updateDateStr;
    }

    @Transient
    public void setUpdateDateStr(String updateDateStr) {
        this.updateDateStr = updateDateStr;
    }

	@Transient
	public String getDrugName() {
		return drugName;
	}
	@Transient
	public void setDrugName(String drugName) {
		this.drugName = drugName;
	}

	public DrugNameDict getDrugNameDict() {
		return drugNameDict;
	}

	public void setDrugNameDict(DrugNameDict drugNameDict) {
		this.drugNameDict = drugNameDict;
	}

	private DrugNameDict drugNameDict;

	public DrugExportDetail() {
		super();
	}

	public DrugExportDetail(String id){
		super(id);
	}

	@Length(min=1, max=64, message="出库主表ID长度必须介于 1 和 64 之间")
	public String getMasterId() {
		return masterId;
	}

	public void setMasterId(String masterId) {
		this.masterId = masterId;
	}
	
	@Length(min=0, max=4, message="序号长度必须介于 0 和 4 之间")
	public String getItemNo() {
		return itemNo;
	}

	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}
	
	@Length(min=1, max=64, message="drug_info表ID长度必须介于 1 和 64 之间")
	public String getInfoId() {
		return infoId;
	}

	public void setInfoId(String infoId) {
		this.infoId = infoId;
	}
	
	@Length(min=1, max=32, message="药品编码长度必须介于 1 和 32 之间")
	public String getDrugCode() {
		return drugCode;
	}

	public void setDrugCode(String drugCode) {
		this.drugCode = drugCode;
	}
	
	@Length(min=0, max=8, message="包装数量长度必须介于 0 和 8 之间")
	public String getPackageNum() {
		return packageNum;
	}

	public void setPackageNum(String packageNum) {
		this.packageNum = packageNum;
	}
	
	@Length(min=1, max=20, message="包装规格长度必须介于 1 和 20 之间")
	public String getPackageSpec() {
		return packageSpec;
	}

	public void setPackageSpec(String packageSpec) {
		this.packageSpec = packageSpec;
	}
	
	@Length(min=1, max=2, message="包装单位长度必须介于 1 和 2 之间")
	public String getPackageUnits() {
		return packageUnits;
	}

	public void setPackageUnits(String packageUnits) {
		this.packageUnits = packageUnits;
	}
	
	@Length(min=1, max=20, message="最小规格长度必须介于 1 和 20 之间")
	public String getMinSpec() {
		return minSpec;
	}

	public void setMinSpec(String minSpec) {
		this.minSpec = minSpec;
	}
	
	@Length(min=1, max=2, message="最小单位长度必须介于 1 和 2 之间")
	public String getMinUnits() {
		return minUnits;
	}

	public void setMinUnits(String minUnits) {
		this.minUnits = minUnits;
	}
	
	@Length(min=1, max=64, message="批号长度必须介于 1 和 64 之间")
	public String getBatchNo() {
		return batchNo;
	}

	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="有效期不能为空")
	public Date getExpireDate() {
		return expireDate;
	}

	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}
	
	public Double getPurchasePrice() {
		return purchasePrice;
	}

	public void setPurchasePrice(Double purchasePrice) {
		this.purchasePrice = purchasePrice;
	}
	
	public String getDiscount() {
		return discount;
	}

	public void setDiscount(String discount) {
		this.discount = discount;
	}
	
	public Double getQuantity() {
		return quantity;
	}

	public void setQuantity(Double quantity) {
		this.quantity = quantity;
	}
	
	public Double getInventory() {
		return inventory;
	}

	public void setInventory(Double inventory) {
		this.inventory = inventory;
	}
	
	@Length(min=0, max=64, message="对应的入库主表ID长度必须介于 0 和 64 之间")
	public String getImportMasterId() {
		return importMasterId;
	}

	public void setImportMasterId(String importMasterId) {
		this.importMasterId = importMasterId;
	}

    public DrugPrice getDrugPrice() {
        return drugPrice;
    }

    public void setDrugPrice(DrugPrice drugPrice) {
        this.drugPrice = drugPrice;
    }

    public DrugStock getDrugStock() {
        return drugStock;
    }

    public void setDrugStock(DrugStock drugStock) {
        this.drugStock = drugStock;
    }

    public DrugInfo getDrugInfo() {
        return drugInfo;
    }

    public void setDrugInfo(DrugInfo drugInfo) {
        this.drugInfo = drugInfo;
    }

    public DrugStorageDept getDrugStorageDept() {
        return drugStorageDept;
    }

    public void setDrugStorageDept(DrugStorageDept drugStorageDept) {
        this.drugStorageDept = drugStorageDept;
    }

    public DrugInoutClass getDrugInoutClass() {
        return drugInoutClass;
    }

    public void setDrugInoutClass(DrugInoutClass drugInoutClass) {
        this.drugInoutClass = drugInoutClass;
    }

    public DrugExportMaster getDrugExportMaster() {
        return drugExportMaster;
    }

    public void setDrugExportMaster(DrugExportMaster drugExportMaster) {
        this.drugExportMaster = drugExportMaster;
    }

    public DrugSupplierCata getDrugSupplierCata() {
        return drugSupplierCata;
    }

    public void setDrugSupplierCata(DrugSupplierCata drugSupplierCata) {
        this.drugSupplierCata = drugSupplierCata;
    }
}